Processors are complex devices that can execute large, multi-part programs that contain code from a variety of sources. For this reason, functions (also called sub-routines) are frequently used to break a program down into more manageable and re-usable pieces. A function is generally arranged as a stand-alone block of program code that can be called as needed by other parts of a program to perform a certain operation.
However, some processors are not arranged to execute function calls in an efficient way. For example, certain special-purpose processors may be configured to perform signal processing tasks in a highly optimised manner. Such special-purpose processors may have an instruction set that is targeted at performing highly efficient mathematical operations, but which is limited in its ability to handle program organisation.
To improve the performance of function calls on such processors, the programmer writing the calling program has generally needed to look inside the code of the function being called, and use the knowledge of how the function is operating to optimise the code of the calling program. This is unsatisfactory, as this breaks the “black box” nature of the function, and means that any change to the function code (which could be done without the knowledge of the programmer) could adversely impact the performance of the program running on the processor by counteracting the optimizations, or cause the program to become inoperable.